# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
  pagination: ./utils/pagination.yml
  commons: ./commons.yml
service:
  auth: true
  base-path: /api/public
  endpoints:
    create:
      docs: Create a score
      method: POST
      path: /scores
      request: CreateScoreRequest
      response: commons.Score
    get:
      docs: Get a list of scores
      method: GET
      path: /scores
      request:
        name: GetScoresRequest
        query-parameters:
          page: optional<integer>
          limit: optional<integer>
          userId: optional<string>
          name: optional<string>
      response: Scores
    get-by-id:
      docs: Get a score
      method: GET
      path: /scores/{scoreId}
      path-parameters:
        scoreId:
          type: string
          docs: The unique langfuse identifier of a score
      response: commons.Score
    delete:
      docs: Delete a score
      method: DELETE
      path: /scores/{scoreId}
      path-parameters:
        scoreId:
          type: string
          docs: The unique langfuse identifier of a score
types:
  CreateScoreRequest:
    properties:
      id: optional<string>
      traceId: string
      name: string
      value: double
      observationId: optional<string>
      comment: optional<string>
  Scores:
    properties:
      data: list<commons.Score>
      meta: pagination.MetaResponse
